<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <form action="post">
    <p>
      <span>用户名</span>
      <input type="text" name="usnam" id="us">
    </p>
    <p> <span>密码</span>
      <input type="password" id="mm" name="psw">
    </p>
    <button onclick="abc()">提交</button>
  </form>
  <script>
    function abc() {
      alert('1')
      var user = document.getElementById('us')

    }
  </script>
</body>

</html>